import 'package:flutter/material.dart';
import 'package:flutter_live/common/model/categorize.dart';
class Categorizes extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('分区'),
        centerTitle: true,
        elevation: 0,
      ),
      body: _Categorizes()
    );
  }

}

class _Categorizes extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      child: GridView.count(
        crossAxisCount: 3,
        crossAxisSpacing: 10.0,
        mainAxisSpacing: 10.0,
        children: List.generate(categorizes.length, (index) {
          return Container(
            child: InkWell(
              onTap: ()=>{
                debugPrint('print:' + categorizes[index].title)
              },
              child: Container(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                  Image.asset(categorizes[index].icon,width: 40),
                  Text(categorizes[index].title,style: TextStyle(height: 1.5),)
                  ],
                ),
            ),
          )
          );
        }),
      )
    );
  }
}